ADO.NET 3.5 Cookbook by Bill Hamilton

ADO.NET 3.5 Cookbook by Bill Hamilton

Author:Bill Hamilton
Language: eng
Format: epub
Tags: COMPUTERS / Software Development & Engineering / General
ISBN: 9780596159580
Publisher: O'Reilly Media
Published: 2008-12-17T00:00:00+00:00


7.5. Using a Transaction with a DataAdapter

Problem

You need to use a transaction when updating a data source using a DataAdapter.

Solution

Associate a Transaction with the Command object for the DataAdapter.

The solution uses a table named DataAdapterTransaction in the AdoDotNet35Cookbook database. Execute the T-SQL in Example 7-8 to create the table.

Example 7-8. Create table DataAdapterTransaction

USE AdoDotNet35Cookbook GO CREATE TABLE DataAdapterTransaction ( Id int NOT NULL PRIMARY KEY, Field1 nvarchar(50) NULL, Field2 nvarchar(50) NULL )



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.